<include file='Common:header' />

<!-- /section:basics/navbar.layout -->
<div class="main-container" id="main-container">

	<!-- #section:basics/sidebar -->

	<include file='Common:left' />
	<!-- /section:basics/sidebar -->
	<div class="main-content">
		<div class="main-content-inner">
			<div class="page-content">

<!-- 				<div class="col-xs-12 col-sm-12 rule-top alert alert-info top10">
					<button type="button" class="close" data-dismiss="alert">
						<i class="ace-icon fa fa-times"></i>
					</button>
					大家可以通过下载数据备份压缩包进行解压，通过mysql管理工具进行导入（暂时不提供数据还原功能，日后若更新，另行通知）
				</div> -->

				<div class="row">
					<div class="col-xs-12">
						<div>
							<form id="export-form" method="post"   class="form-horizontal"  action="{:U('export')}">
								<table class="table table-striped table-bordered table-hover" id="dynamic-table">
									<thead>
									<tr>
										<th>备份名称</th>
										<th>卷数</th>
										<th>压缩</th>
										<th class="hidden-sm hidden-xs">数据大小</th>
										<th class="hidden-sm hidden-xs">备份时间</th>
										<th style="border-right:#CCC solid 1px;">操作</th>
									</tr>
									</thead>

									<tbody>

									<foreach name="data_list" item="v">
										<tr>
											<td height="28">{$v.time|date='Ymd-His',###}</td>
											<td>{$v.part}</td>
											<td>{$v.compress}</td>
											<td class="hidden-sm hidden-xs">{$v.size|format_bytes}</td>
											<td class="hidden-sm hidden-xs">{$key}</td>
											<td>
												<div class="hidden-sm hidden-xs action-buttons">
													<a class="db-import restore" href="{:U('restore?time='.$v['time'])}" title="还原">
														<i class="ace-icon fa fa-reply-all bigger-130"></i>
													</a>												
													<a class="db-import" href="__PUBLIC__/Data/{$v.time|date='Ymd-His',###}-{$v.part}.sql.{$v.compress}" title="下载">
														<i class="ace-icon fa fa-cloud-download bigger-130"></i>
													</a>
													<a class="ajax-get confirm del" href="{:U('del?time='.$v['time'])}"  title="删除">
														<i class="ace-icon fa fa-trash-o bigger-130"></i>
													</a>
												</div>
												<div class="hidden-md hidden-lg">
													<div class="inline position-relative">
														<button class="btn btn-minier btn-primary dropdown-toggle" data-toggle="dropdown" data-position="auto">
															<i class="ace-icon fa fa-cog icon-only bigger-110"></i>
														</button>
														<ul class="dropdown-menu dropdown-only-icon dropdown-yellow dropdown-menu-right dropdown-caret dropdown-close">
															<li>
																<a href="{:U('restore?time='.$v['time'])}"  class="tooltip-success restore" data-rel="tooltip" title="" data-original-title="还原">
																	<span class="green">
																		<i class="ace-icon fa fa-reply-all bigger-120"></i>
																	</span>
																</a>
															</li>
															<li>
																<a href="__PUBLIC__/Data/{$v.time|date='Ymd-His',###}-{$v.part}.sql.{$v.compress}" class="tooltip-success" data-rel="tooltip" title="" data-original-title="下载">
																	<span class="green">
																		<i class="ace-icon fa fa-cloud-download bigger-120"></i>
																	</span>
																</a>
															</li>

															<li>
																<a href="{:U('del?time='.$v['time'])}"  class="tooltip-error ajax-get confirm del" data-rel="tooltip" title="" data-original-title="删除">
																	<span class="red">
																		<i class="ace-icon fa fa-trash-o bigger-120"></i>
																	</span>
																</a>
															</li>
														</ul>
													</div>
												</div>
											</td>
										</tr>
									</foreach>
									<tr>
										<td height="50" colspan="7" align="left">&nbsp;</td>
									</tr>
									</tbody>
								</table>
							</form>
						</div>
					</div>
				</div>

				<include file='Common:header_nav' />

			</div><!-- /.page-content -->
		</div>
	</div><!-- /.main-content -->


    <script type="text/javascript">
        (function($){
            var $del = $(".del");
            var $restore = $(".restore");
            $del.click(function(){
				var $url=this.href;
				layer.confirm('你确定要删除吗？', {icon: 3}, function(index){
				layer.close(index);
				$.get($url, function(data){
                    if(data.status){
                        layer.alert(data.info, {icon: 6}, function(index){
                            layer.close(index);
                            window.location.href=data.url;
                        });
                    } else {
                        layer.alert(data.info, {icon: 5}, function(index){
                            layer.close(index);
                            //window.location.href="{:U('import')}";
                        });
                    }
                }, "json");
				});
                return false;
            });
            $restore.click(function(){
                $.get(this.href, function(data){
                    if(data.status){
                        layer.alert(data.info, {icon: 6}, function(index){
                            layer.close(index);
                            window.location.href=data.url;
                        });
                    } else {
                        layer.alert(data.info, {icon: 5}, function(index){
                            layer.close(index);
                            //window.location.href="{:U('import')}";
                        });
                    }
                }, "json");
                return false;
            });
        })(jQuery)

	</script>

	<include file='Common:footer' />

</div><!-- /.main-container -->
</body>
</html>
